shader_type spatial;
render_mode unshaded;

uniform vec4 bg_color: hint_color;
uniform vec4 fg_color: hint_color;
uniform float scale;
uniform float speed;

bool triangle(float x,float y){
//	if (x < 0.3) {
//		return false;
//	}
	if (abs(y-0.5)+x-0.5 > 0.5) {
		return false;
	}
	if (abs(y-0.5)+x-0.5 < 0.3) {
		return false;
	}
	return true;
}

void fragment(){
	float x = UV.x;
	float y = UV.y;
	float unity = 1.0;
	
	x -= TIME*speed;
	x = x - floor(x);
	
	if (triangle(x,y)){
		ALBEDO = fg_color.xyz;
	} else{
		ALBEDO =  bg_color.xyz;
	}
}
